<template>
  <div>
    <jv-table :tableObj="tableObj"></jv-table>
  </div>
</template>
<script>
const tableSchema = [
  {
    prop: "link",
    label: "跳转链接",
    cpn: "Link",
    cpnProps: {
      // 路由名称
      routeName: "detail",
      // 路由路径（名称和路径二选一）
      // routePath:'/dashboard',
      // 路由传参方式 默认query
      methods: "query",
      // 传参的键名，值为当前数据
      parameterKey: "BillId",
      // 补充动态参数
      moreDynamicParameters: [
        {
          keyName: "resId",
          valueName: "name"
        },
        {
          keyName: "BillId",
          valueName: "id"
        }
      ],
      // 补充静态参数
      moreStaticParameters: {
        type: 1
      }
    }
  },
  {
    prop: "imageUrl",
    label: "图片",
    cpn: "Image",
    cpnProps: {
      //Image的props与element的el-image一直 按需配置
      // lazy: true,
      // fit:'scale-down'
      // 宽高默认 38px
      // width:'50px',
      // height:'50px',
      // 自定义前缀 不填为默认路径
      preUrl: "https://fuss10.elemecdn.com/"
    },
    // 导出配置
    exportConfig: {
      // 禁用这个字段的导出功能
      disabled: true
    }
  }
];
export default {
  data() {
    return {
      tableData: [
        {
          link: "张三",
          imageUrl: "e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
        },
        {
          link: "李四",
          imageUrl: "e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
        },
        {
          link: "李四",
          imageUrl: "e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
        },
        {
          link: "李四",
          imageUrl: "e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
        }
      ],
      tableObj: {}
    };
  },
  created() {
    this.tableObj = this.$JTable({
      tableSchema: tableSchema,
      title: "表格demo",
      data: this.tableData,
      operationCol: false
    });
  }
};
</script>
